/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package comandaXM.accions;
import comandaXM.classes.manteniment.auxiliar.Pais;
import comandaXM.classes.manteniment.auxiliar.Provincia;
import comandaXM.classes.manteniment.proveidor.*;
import comandaXM.excepcions.ExceptionHibernate;
import comandaXM.model.manteniment.auxiliars.ProveidorModel;
import java.util.List;

/**
 *
 * @author xmarti
 */
public class ProveidorsAct {
    private ProveidorModel model; 
    public ProveidorsAct (){
        this.model= new ProveidorModel() ; 
    }    
    public Proveidor getProveidor(int id) throws ExceptionHibernate {        
        return model.getProveidor(id);
    }
    public List<Proveidor> getProveidors(String codi,String cif, String nomFiscal, String nomComercial, String direccio, String poblacio, String codiPostal,Provincia provincia, Pais pais) throws ExceptionHibernate {
        return model.getListProveidors(codi,cif, nomFiscal, nomComercial, direccio, poblacio, codiPostal,provincia,pais); 
    }
    public int add(Proveidor p) throws ExceptionHibernate{
        return model.add(p); 
    }
    public int add(CentreProveidor p) throws ExceptionHibernate{
        return model.add(p); 
    }
    public int add(Contacte p) throws ExceptionHibernate{
        return model.add(p); 
    }
    public int add(Notificacio p) throws ExceptionHibernate{
        return model.add(p); 
    }
    public boolean update (Object object) throws ExceptionHibernate{
        return model.update(object); 
    }
    public boolean remove ( Object object ) throws ExceptionHibernate{
        return model.delete(object); 
    }
    
}
